package com.channel.springcloud.controller;

import com.channel.springcloud.model.APIResult;
import com.channel.springcloud.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BookController {
    @Autowired
    private BookService bookService;
    @GetMapping("/service/goods")
    public APIResult getAll(){
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("9200执行~~~~");
        return new APIResult(0,bookService.getAll(),"查询成功");
    }
}
